
%%
%%
%% the groovy language spec
%%
%%

\documentclass[10pt,letterpaper]{book}


%%
%% Package Imports
%%

\usepackage{alltt}
%\usepackage{cite}
%\usepackage{plain}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{varioref}
\usepackage{tabularx}
%\usepackage{array}
%\usepackage{color}
\usepackage{makeidx}
%\usepackage{showidx}

%%
%% Extra Commands and Evironments
%%

\newenvironment{codelisting}%
	{\bigskip\begin{minipage}{250pt}\footnotesize\begin{alltt}}%
	{\end{alltt}\end{minipage}\bigskip}

\newenvironment{basenote}[1]
	{
		\begin{flushright}
		\vline \hspace{1em}
		\begin{minipage}{0.7\linewidth}
		\hspace{-1em}\textsf{\textbf{#1}}\\  
		\rule{0em}{1.4em}
		\sl
	} {
		\end{minipage}
		\end{flushright}
	}

\newenvironment{indnote}[1]
	{
		\begin{flushright}
		\vline \hspace{1em}
		\begin{minipage}{0.9\linewidth}
		\hspace{-1em}\textsf{\textbf{#1's note}}\\  
		\rule{0em}{1.4em}
		\sl
	} {
		\end{minipage}
		\end{flushright}
	}

\newenvironment{note}
	{
		\begin{basenote}{Note}
	} {
		\end{basenote}
	}

\newenvironment{ednote}
	{
		\begin{basenote}{Editor's Note}
	} {
		\end{basenote}
	}

\newenvironment{implnote}
	{
		\begin{basenote}{Implementor's Note}
	} {
		\end{basenote}
	}

\newcommand{\diagram}[2]{
  \bigskip
  \begin{figure}[h]
    \begin{center}
      \includegraphics[scale=0.5]{#1}
    \end{center}
    \caption{#2}
  \end{figure} 
  \medskip
}

\newcommand{\indexfile}[1]{\texttt{#1}\index{#1@\texttt{#1} file}}
\newcommand{\indexclass}[1]{\texttt{#1}\index{#1@\texttt{#1} class}}
\newcommand{\indexclassex}[1]{\index{#1@\texttt{#1}!example}}
\newcommand{\indexmethod}[2]{\texttt{#2}\index{#1@\texttt{#1} class!#2@\texttt{#2} method}}

\newcommand{\indexkeyword}[1]{\texttt{#1}\index{#1@\texttt{#1} keyword}}
\newcommand{\indexoperator}[1]{\texttt{#1}\index{#1@\texttt{#1} operator}}

\newcommand{\file}[1]{\texttt{#1} file}
\newcommand{\class}[1]{\texttt{#1}}
\newcommand{\method}[1]{\texttt{#1}}

\raggedbottom

\clubpenalty = 10000
\widowpenalty = 10000 
\makeindex

\begin{document}

\let\footnoterule\hrule

\makeatletter
\renewcommand{\@makefntext}[1]%
	{\noindent\makebox[1.8em][r]{\@makefnmark}#1}
\makeatother

\title{
	Groovy Language Specification
}

\author{
	\textsf{The Codehaus}\\
	\textsf{www.codehaus.org}\\
}


\frontmatter

\maketitle

\tableofcontents

\listoffigures 

\include{preface}

\mainmatter

\include{keywords}
\include{operators}
\include{expressions}
\include{statements}

\index{Betty|see{betty}}
\index{betty|see{Betty}}

\appendix

\include{faq}
\include{license}

\backmatter

\include{colophon}

\small
\printindex

\end{document}
